/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package deatax;

import deatax.display.Texture;
import deatax.display.gui.ResourcesPanel;
import deatax.markers.HouseMarker;
import deatax.markers.Marker;
import java.awt.Color;
import java.awt.Image;
import javax.swing.JPanel;

/**
 *
 * @author pson
 */
public class Settlement extends Improvement {

    private static Image POPULATION_IMAGE = null;
    private static int MAX_RANGE = 0;
    private int level;
    private int basePopulation;
    private int populationGrowth;
    private int populationFactor;
    private int maxPopulation;
    private int taxRate;
    private HouseMarker marker;

    public Settlement(String name, int score, int level, int base, int growth, int factor, int max, int rate) {
        super(name, score);
        this.level = level;
        basePopulation = base;
        populationGrowth = growth;
        populationFactor = factor;
        maxPopulation = max;
        taxRate = rate;
        if (level > MAX_RANGE) {
            MAX_RANGE = level;
        }
        marker = new HouseMarker(null);
    }

    public static int getMaxRange() {
        return MAX_RANGE;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getBasePopulation() {
        return basePopulation;
    }

    public void setBasePopulation(int basePopulation) {
        this.basePopulation = basePopulation;
    }

    public int getMaxPopulation() {
        return maxPopulation;
    }

    public void setMaxPopulation(int maxPopulation) {
        this.maxPopulation = maxPopulation;
    }

    public int getPopulationFactor() {
        return populationFactor;
    }

    public void setPopulationFactor(int populationFactor) {
        this.populationFactor = populationFactor;
    }

    public int getPopulationGrowth() {
        return populationGrowth;
    }

    public void setPopulationGrowth(int populationGrowth) {
        this.populationGrowth = populationGrowth;
    }

    public int getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(int taxRate) {
        this.taxRate = taxRate;
    }

    public static Image getPopulationImage() {
        if (POPULATION_IMAGE == null) {
            POPULATION_IMAGE = Texture.loadImage("icons/pop.png");
        }
        return POPULATION_IMAGE;
    }

    @Override
    public Marker getMarkerRenderer(Player p) {
        marker.setOwner(p);
        return marker;
    }

}
